﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Optimization;
using System.Web.Routing;
using System.Web.Security;
using AdminSite;

namespace AdminSite
{
    public class Global : HttpApplication
    {
        void Application_Start(object sender, EventArgs e)
        {
            // Code that runs on application startup
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterOpenAuth();

            //Adding some admins
            CreateUser("Admin", "Pa$$word", "admin@test.com");
            CreateUser("MainAdmin", "Pa$$word", "mainadmin@test.com");

        }

        private void CreateUser(string login,string password, string email)
        {
            if (Membership.GetUser(login) == null)
            {
                Membership.CreateUser(login, password, email);
            }
        }

        void Application_End(object sender, EventArgs e)
        {
            //  Code that runs on application shutdown

        }

        void Application_Error(object sender, EventArgs e)
        {


        }
    }
}
